Crate brownstone[][src]

Expand description

brownstone is a library for building fixed-size arrays. It provides a collection of optimizer-friendly fallible and infallible function that build arrays by calling initializer functions in a loop. It also provides a low-level builder type, with a push + finish interface, as well as a misuse- immune builder type with a move-based interface that can never panic or return errors.

Modules

A low level builder type for creating fixed size arrays.

A misuse-immune array builder.

Structs

Error returned from the fallible try_build_* functions in this crate. This includes the original error returned from the input function, along with the index where the error occurred.

Functions

Build a fixed-size array with an initializer function. The initializer is called once for each item in the length of the array, and the completed array is returned.

Build a fixed-size array out of clones of some element. The element itself is used as the first element in the array.

Build a fixed-size array with an initializer function. The initializer is called once for each item in the length of the array, and the completed array is returned.

Build a fixed-size array from an iterator. The first N elements of the iterator are collected into an array of length N.

Build a fixed-size array with an initializer function. The initializer is called once for each item in the length of the array, and the completed array is returned.

Build a fixed-size array with a fallible initializer function. The initializer is called once for each item in the length of the array, in order; if it ever returns an Err, that error is propagated (along with the index of the failed item).

Build a fixed-size array with a fallible initializer function. The initializer is called once for each item in the length of the array, in order; if it ever returns an Err, that error is propagated (along with the index of the failed item).

Build a fixed-size array from an iterator. The first N elements of the iterator are collected into an array of length N. Returns None if the iterator doesn’t yield enough elements.

Build a fixed-size array with a fallible initializer function. The initializer is called once for each item in the length of the array, in order; if it ever returns an Err, that error is propagated (along with the index of the failed item).